package com.sudo.common.service;

import com.github.pagehelper.PageInfo;
import com.sudo.common.utils.PagedGridResult;
import com.sudo.common.utils.RandomUtil;

import java.util.List;

public class BaseService {

    // 静态资源文件前缀，用来访问（逻辑前缀）
    public final static String resourcePath = "fileSpace";

    public PagedGridResult setterPagedGrid(List<?> list, Integer page) {
        PageInfo<?> pageList = new PageInfo<>(list);
        PagedGridResult gridResult = new PagedGridResult();
        gridResult.setPage(page);
        gridResult.setRows(list);
        gridResult.setTotal(pageList.getPages());
        gridResult.setRecords(pageList.getTotal());
        return gridResult;
    }

}
